package com.xiaoshuidi.cloud.module.finance.dal.dataobject.invoice;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.xiaoshuidi.cloud.framework.tenant.core.db.TenantBaseDO;
import lombok.*;

import java.util.function.Consumer;

/**
 * 开票配置
 *
 * @author Auto generated
 * @date Fri Jul 14 11:01:27 CST 2023
 **/
@Data
@Builder
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@NoArgsConstructor
@AllArgsConstructor
@TableName(value = "finance_invoice_config", autoResultMap = true)
public class FinanceInvoiceConfigDO extends TenantBaseDO {

    @TableId
    private Integer id;
    private String companyName;
    /**
     * 企业税号
     */
    private String companyTaxpayerId;
    /**
     * 开票人
     */
    private String drawer;
    /**
     * 收款人
     */
    private String payee;
    /**
     * 复核人
     */
    private String reviewer;
    private String bankName;
    /**
     * 银行账号
     */
    private String bankAccount;
    /**
     * 地址
     */
    private String address;
    private String phone;
    /**
     * 航信开票接口授权码
     */
    private String hangxinAuthCode;
    /**
     * 是否启用
     */
    private Boolean enable;
    private Boolean personApplyApproval;
    /**
     * 企业开票是否审核
     */
    private Boolean companyApplyApproval;
    /**
     * 企业冲红审核
     */
    private Boolean companyReversalApproval;
    /**
     * 个人冲红是否审核
     */
    private Boolean personReversalApproval;
    private String remark;

    public void enable(Consumer<Boolean> ...field) {
        for (Consumer<Boolean> a : field) {
            a.accept(true);
        }
    }
    public void disable(Consumer<Boolean> ...field) {
        for (Consumer<Boolean> a : field) {
            a.accept(false);
        }
    }
}
